package entity;
/**
 * 书类
 * @author yy
 *
 */
public class Book {
	private String id;
	private String name;
	private Integer StoreNum;
	private Double price;
	private Integer buyNum;
	private Gift gift;
	
	public Book(String id, String name, Integer storeNum, Double price) {
		this.id = id;
		this.name = name;
		StoreNum = storeNum;
		this.price = price;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getStoreNum() {
		return StoreNum;
	}

	public void setStoreNum(Integer storeNum) {
		StoreNum = storeNum;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public Integer getBuyNum() {
		return buyNum;
	}

	public void setBuyNum(Integer buyNum) {
		this.buyNum = buyNum;
	}

	public void setGift(Gift gift) {
		this.gift = gift;
	}

	public Gift getGift(){
		return gift;
	}

	public double calcPrice(){
		if(gift != null){
			return price * buyNum + gift.giftPrice; 
		}
		return price * buyNum;
	}

}
